package cn.jiyun.service.impl;

import cn.jiyun.entity.XmRole;
import cn.jiyun.mapper.XmRoleMapper;
import cn.jiyun.service.IXmRoleService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2024-11-21
 */
@Service
public class XmRoleServiceImpl extends ServiceImpl<XmRoleMapper, XmRole> implements IXmRoleService {

    @Override
    public Page findPage(Integer pageNum, Integer pageSize, XmRole xmRole) {
        Page<XmRole> xmRolePage = new Page<>(pageNum, pageSize);
        LambdaQueryWrapper<XmRole> qr = new LambdaQueryWrapper<>();
        qr.like(xmRole.getRoleName()!=null,XmRole::getRoleName,xmRole.getRoleName());
        return baseMapper.selectPage(xmRolePage,qr);
    }
}
